module imm_gen(
    input  wire [31:0] instr,
    output wire [31:0] imm_i
);
    // I-type: imm[11:0] = instr[31:20]
    assign imm_i = {{20{instr[31]}}, instr[31:20]};
endmodule
